Optimal. Leaf size=227 \[ -\frac{\sqrt{\pi } b^2 e^{a+\frac{b^2}{4 c}} \text{Erf}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )}{16 c^{5/2}}-\frac{\sqrt{\pi } e^{a+\frac{b^2}{4 c}} \text{Erf}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )}{8 c^{3/2}}-\frac{\sqrt{\pi } b^2 e^{-a-\frac{b^2}{4 c}} \text{Erfi}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )}{16 c^{5/2}}+\frac{\sqrt{\pi } e^{-a-\frac{b^2}{4 c}} \text{Erfi}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )}{8 c^{3/2}}-\frac{b \sinh \left (a+b x-c x^2\right )}{4 c^2}-\frac{x \sinh \left (a+b x-c x^2\right )}{2 c} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.142058, antiderivative size = 227, normalized size of antiderivative = 1., number of steps used = 12, number of rules used = 7, integrand size = 16, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.438, Rules used = {5387, 5374, 2234, 2205, 2204, 5383, 5375} \[ -\frac{\sqrt{\pi } b^2 e^{a+\frac{b^2}{4 c}} \text{Erf}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )}{16 c^{5/2}}-\frac{\sqrt{\pi } e^{a+\frac{b^2}{4 c}} \text{Erf}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )}{8 c^{3/2}}-\frac{\sqrt{\pi } b^2 e^{-a-\frac{b^2}{4 c}} \text{Erfi}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )}{16 c^{5/2}}+\frac{\sqrt{\pi } e^{-a-\frac{b^2}{4 c}} \text{Erfi}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )}{8 c^{3/2}}-\frac{b \sinh \left (a+b x-c x^2\right )}{4 c^2}-\frac{x \sinh \left (a+b x-c x^2\right )}{2 c} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 5387
Rule 5374
Rule 2234
Rule 2205
Rule 2204
Rule 5383
Rule 5375
Rubi steps
\begin{align*} \int x^2 \cosh \left (a+b x-c x^2\right ) \, dx &=-\frac{x \sinh \left (a+b x-c x^2\right )}{2 c}+\frac{\int \sinh \left (a+b x-c x^2\right ) \, dx}{2 c}+\frac{b \int x \cosh \left (a+b x-c x^2\right ) \, dx}{2 c}\\ &=-\frac{b \sinh \left (a+b x-c x^2\right )}{4 c^2}-\frac{x \sinh \left (a+b x-c x^2\right )}{2 c}+\frac{b^2 \int \cosh \left (a+b x-c x^2\right ) \, dx}{4 c^2}+\frac{\int e^{a+b x-c x^2} \, dx}{4 c}-\frac{\int e^{-a-b x+c x^2} \, dx}{4 c}\\ &=-\frac{b \sinh \left (a+b x-c x^2\right )}{4 c^2}-\frac{x \sinh \left (a+b x-c x^2\right )}{2 c}+\frac{b^2 \int e^{a+b x-c x^2} \, dx}{8 c^2}+\frac{b^2 \int e^{-a-b x+c x^2} \, dx}{8 c^2}-\frac{e^{-a-\frac{b^2}{4 c}} \int e^{\frac{(-b+2 c x)^2}{4 c}} \, dx}{4 c}+\frac{e^{a+\frac{b^2}{4 c}} \int e^{-\frac{(b-2 c x)^2}{4 c}} \, dx}{4 c}\\ &=-\frac{e^{a+\frac{b^2}{4 c}} \sqrt{\pi } \text{erf}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )}{8 c^{3/2}}+\frac{e^{-a-\frac{b^2}{4 c}} \sqrt{\pi } \text{erfi}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )}{8 c^{3/2}}-\frac{b \sinh \left (a+b x-c x^2\right )}{4 c^2}-\frac{x \sinh \left (a+b x-c x^2\right )}{2 c}+\frac{\left (b^2 e^{-a-\frac{b^2}{4 c}}\right ) \int e^{\frac{(-b+2 c x)^2}{4 c}} \, dx}{8 c^2}+\frac{\left (b^2 e^{a+\frac{b^2}{4 c}}\right ) \int e^{-\frac{(b-2 c x)^2}{4 c}} \, dx}{8 c^2}\\ &=-\frac{b^2 e^{a+\frac{b^2}{4 c}} \sqrt{\pi } \text{erf}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )}{16 c^{5/2}}-\frac{e^{a+\frac{b^2}{4 c}} \sqrt{\pi } \text{erf}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )}{8 c^{3/2}}-\frac{b^2 e^{-a-\frac{b^2}{4 c}} \sqrt{\pi } \text{erfi}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )}{16 c^{5/2}}+\frac{e^{-a-\frac{b^2}{4 c}} \sqrt{\pi } \text{erfi}\left (\frac{b-2 c x}{2 \sqrt{c}}\right )}{8 c^{3/2}}-\frac{b \sinh \left (a+b x-c x^2\right )}{4 c^2}-\frac{x \sinh \left (a+b x-c x^2\right )}{2 c}\\ \end{align*}
Mathematica [A] time = 0.289864, size = 152, normalized size = 0.67 \[ \frac{\sqrt{\pi } \left (b^2+2 c\right ) \text{Erf}\left (\frac{2 c x-b}{2 \sqrt{c}}\right ) \left (\sinh \left (a+\frac{b^2}{4 c}\right )+\cosh \left (a+\frac{b^2}{4 c}\right )\right )+\sqrt{\pi } \left (b^2-2 c\right ) \text{Erfi}\left (\frac{2 c x-b}{2 \sqrt{c}}\right ) \left (\cosh \left (a+\frac{b^2}{4 c}\right )-\sinh \left (a+\frac{b^2}{4 c}\right )\right )-4 \sqrt{c} (b+2 c x) \sinh (a+x (b-c x))}{16 c^{5/2}} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.044, size = 244, normalized size = 1.1 \begin{align*}{\frac{x{{\rm e}^{c{x}^{2}-bx-a}}}{4\,c}}+{\frac{b{{\rm e}^{c{x}^{2}-bx-a}}}{8\,{c}^{2}}}+{\frac{{b}^{2}\sqrt{\pi }}{16\,{c}^{2}}{{\rm e}^{-{\frac{4\,ac+{b}^{2}}{4\,c}}}}{\it Erf} \left ( \sqrt{-c}x+{\frac{b}{2}{\frac{1}{\sqrt{-c}}}} \right ){\frac{1}{\sqrt{-c}}}}-{\frac{\sqrt{\pi }}{8\,c}{{\rm e}^{-{\frac{4\,ac+{b}^{2}}{4\,c}}}}{\it Erf} \left ( \sqrt{-c}x+{\frac{b}{2}{\frac{1}{\sqrt{-c}}}} \right ){\frac{1}{\sqrt{-c}}}}-{\frac{x{{\rm e}^{-c{x}^{2}+bx+a}}}{4\,c}}-{\frac{b{{\rm e}^{-c{x}^{2}+bx+a}}}{8\,{c}^{2}}}-{\frac{{b}^{2}\sqrt{\pi }}{16}{{\rm e}^{{\frac{4\,ac+{b}^{2}}{4\,c}}}}{\it Erf} \left ( -\sqrt{c}x+{\frac{b}{2}{\frac{1}{\sqrt{c}}}} \right ){c}^{-{\frac{5}{2}}}}-{\frac{\sqrt{\pi }}{8}{{\rm e}^{{\frac{4\,ac+{b}^{2}}{4\,c}}}}{\it Erf} \left ( -\sqrt{c}x+{\frac{b}{2}{\frac{1}{\sqrt{c}}}} \right ){c}^{-{\frac{3}{2}}}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [B] time = 1.61316, size = 1126, normalized size = 4.96 \begin{align*} \text{result too large to display} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] time = 2.12858, size = 1065, normalized size = 4.69 \begin{align*} -\frac{4 \, c^{2} x - 2 \,{\left (2 \, c^{2} x + b c\right )} \cosh \left (c x^{2} - b x - a\right )^{2} + \sqrt{\pi }{\left ({\left (b^{2} - 2 \, c\right )} \cosh \left (c x^{2} - b x - a\right ) \cosh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right ) -{\left (b^{2} - 2 \, c\right )} \cosh \left (c x^{2} - b x - a\right ) \sinh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right ) +{\left ({\left (b^{2} - 2 \, c\right )} \cosh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right ) -{\left (b^{2} - 2 \, c\right )} \sinh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right )\right )} \sinh \left (c x^{2} - b x - a\right )\right )} \sqrt{-c} \operatorname{erf}\left (\frac{{\left (2 \, c x - b\right )} \sqrt{-c}}{2 \, c}\right ) - \sqrt{\pi }{\left ({\left (b^{2} + 2 \, c\right )} \cosh \left (c x^{2} - b x - a\right ) \cosh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right ) +{\left (b^{2} + 2 \, c\right )} \cosh \left (c x^{2} - b x - a\right ) \sinh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right ) +{\left ({\left (b^{2} + 2 \, c\right )} \cosh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right ) +{\left (b^{2} + 2 \, c\right )} \sinh \left (\frac{b^{2} + 4 \, a c}{4 \, c}\right )\right )} \sinh \left (c x^{2} - b x - a\right )\right )} \sqrt{c} \operatorname{erf}\left (\frac{2 \, c x - b}{2 \, \sqrt{c}}\right ) - 4 \,{\left (2 \, c^{2} x + b c\right )} \cosh \left (c x^{2} - b x - a\right ) \sinh \left (c x^{2} - b x - a\right ) - 2 \,{\left (2 \, c^{2} x + b c\right )} \sinh \left (c x^{2} - b x - a\right )^{2} + 2 \, b c}{16 \,{\left (c^{3} \cosh \left (c x^{2} - b x - a\right ) + c^{3} \sinh \left (c x^{2} - b x - a\right )\right )}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F] time = 0., size = 0, normalized size = 0. \begin{align*} \int x^{2} \cosh{\left (a + b x - c x^{2} \right )}\, dx \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.22861, size = 225, normalized size = 0.99 \begin{align*} -\frac{\frac{\sqrt{\pi }{\left (b^{2} + 2 \, c\right )} \operatorname{erf}\left (-\frac{1}{2} \, \sqrt{c}{\left (2 \, x - \frac{b}{c}\right )}\right ) e^{\left (\frac{b^{2} + 4 \, a c}{4 \, c}\right )}}{\sqrt{c}} + 2 \,{\left (c{\left (2 \, x - \frac{b}{c}\right )} + 2 \, b\right )} e^{\left (-c x^{2} + b x + a\right )}}{16 \, c^{2}} - \frac{\frac{\sqrt{\pi }{\left (b^{2} - 2 \, c\right )} \operatorname{erf}\left (-\frac{1}{2} \, \sqrt{-c}{\left (2 \, x - \frac{b}{c}\right )}\right ) e^{\left (-\frac{b^{2} + 4 \, a c}{4 \, c}\right )}}{\sqrt{-c}} - 2 \,{\left (c{\left (2 \, x - \frac{b}{c}\right )} + 2 \, b\right )} e^{\left (c x^{2} - b x - a\right )}}{16 \, c^{2}} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]